home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir30
/
dfx23d3.zip
/
README.DOC
< prev
Wrap
Text File
|
1994-03-27
|
4KB
|
86 lines
This is a simple program to convert a DXF file from AutoCAD to an object
include file for the 3DVECT35 3D Vector package. I know it works with
release 12, but I assume it will work with previous versions (within reason).
DXF23D3 takes 3 arguments. The first is the input file (filename.dxf).
Next is the output file (filename.inc, for example). Next is the layer
number to extract from the dxf file. -1 causes 3d faces from all layers to
be extraced. Next is the scale factor. This can be a floating point number
of any size until it crashes (it's a DOUBLE). This is so you don't have to
worry about scaling your object until you are ready to create the ".inc"
file.
Format example:
DXF23D2 BOX.DXF BOX.INC -1 3.4
This extracts all 3D faces from box.dxf, scaling it times 3.4, and putting
the information into box.inc (duh).
Some notes:
Points are changes to integers by the equivalent BASIC
command: x_integer=INT(x_float+0.5)
This is so that 1.5 or 1.6 rounds to 2, while 0.3 or 0.49
will round to 1.
While only unique points are given a point definition in
the output file and face declarations, if the scale is small
enough, you could notice some repeated point declarations.
This is because the points are tested for redundancy while
they are still floats. You can track it down and change it
in the source if you like. It was compiled both by TC 3.1
and BC 4.0. I think the final version is with TC, because
I personally think that the BC4 editor sucks (I have a
60 MHz Pentium, and its still unbearably slow) and its a
real pain to use.
The maximum points & faces allowed are 1000 each. 10 points per
face. This is mostly because I was just too lazy to not work
with almost all global variables. You will likely notice that
the program structure is far from optimized, but if you're
going to have that huge of a single object, it will probably
run too slowly in your demo or whatever, anyway.
Colors are not extracted from the DXF. Everything is
dfltcolr (default-color) which I have arbitrarily set to
1. It is set as an equ statement near the top of the file,
so set it to whatever you want. All faces are output to
"shade" for lambert shading with 3 0's after the face
definitions. If this is not to your liking, just use a
REPLACE_ALL from your editor.
Sorry this thing is not just loaded with features, but I
just wrote it last night after a Thermodynamics 2 test,
so I was just kind of messing around.
WHEN DRAWING IN AUTOCAD:
You must draw the 3D faces in the point order (counter-clockwise)
to make them visible. This really is no big deal. You can draw
whatever you want in wireframe, and then just plop the 3d faces
on last (y'know line|intersection|intersection|intersection etc.)
Before saving the DXF, set the origin to where you want the
point 0,0,0 of your object to be. Also, you need to set the
coordinate axes to be compatible with the 3D3 package (y negative
down, etc). If you don't know how to do this, this is how:
[these are things you type] <these are things you pick w/mouse or whatever>
UCS [RETURN (or space) ; user coordinate system
3 [RETRUN] ; set a 3-point coord system
; now you need to pick the part of your object to be @ (0,0,0)
; next pick a point to be on the X axis, and then one for the
; Y axis. This will set up the cartesian coordinates for
; your
; object.
Now just save your object as a DXF. That's it.
------------------------------------------------------------------------------
This program is free. If it helps you out, I'm glad. If it
doesn't--tough. If it performs a low level format on your
hard disk, you have been warned. Happy coding!